import java.security.Permission;

/**
 * 禁用所有权限
 * SecurityManager在Jdk17后被弃用
 */
public class DenySecurityManager extends SecurityManager {
    /**
     * 检测所有的权限
     * @param perm   the requested permission.
     */
    @Override
    public void checkPermission(Permission perm) {
        throw new SecurityException("权限不足" + perm.toString());
        // super.checkPermission(perm);
    }
}
